In [1]:
%matplotlib inline
import itertools
import matplotlib
import matplotlib.pyplot
import numpy
import os
import pandas
import scipy.misc
import scipy.special
import scipy.stats
import seaborn
In [2]:
# colormap for data visualizations
cmap = seaborn.cubehelix_palette(n_colors = 20, start = 0.8, rot = 0.75,
gamma = 0.3, hue = 2.0, dark = 0.005,
light = 0.95, reverse = True, as_cmap = True)
How many different combinations of advisors and retired advisor stickers exist? Is it as straightforward as enumerating the combinations between the number of empty advisor slots and retired advisor stickers? Though this creates an upper limit, does the order of the retired advisor stickers prevent some combinations from happening? The number of players will effect the distribution of stickers at the end of the game. The timing of boxes openning will bias the addition of stickers to earlier advisors. Therefore, in addition to the possible combinations, what is the distribution of retired advisor stickers? I think this last question is best answered through simulation.
In [4]:
df_advisors = pandas.read_excel("advisors.xlsx")
df_retired = pandas.read_excel("retired_advisors.xlsx")
In [10]:
sum_empty_slots = numpy.sum(df_advisors["empty_slots"])
sum_retired_stickers = len(df_retired)*3 # There are 3 stickers on each retired advisor
print("The number of empty slots in the advisor deck is", sum_empty_slots)
print("The number of retired advisor stickers is", sum_retired_stickers)
In [15]:
number_unique_advisor_decks = scipy.special.comb(sum_empty_slots, sum_retired_stickers)
print("The unique number of decks is", number_unique_advisor_decks)
There are 63 empty slots across all of the advisors and 42 retired advisor stickers. The number of unique advisor decks that can exist after all retired advisor stickers have been placed onto empty slots is almost 30 quadrillion! However, this is an overestimate of the actual number of unique decks since there are duplicates of most of the retired advisors across the 4 guilds.
https://math.stackexchange.com/questions/1902850/efficient-algorithm-to-find-all-unique-combinations-of-set-given-duplicates http://mathforum.org/library/drmath/view/56197.html https://math.stackexchange.com/questions/2131/permutations-with-duplicates https://math.stackexchange.com/questions/114654/permutations-of-subsets-of-a-multiset/ https://mathoverflow.net/questions/33273/combinations-of-multisets-with-finite-multiplicities
We'll have to calculate the combination of a mutliset to derive the account for duplicated stickers.
To help with the math we'll pretend we have 21 null stickers to add to the 42 retired advisor stickers to match the number of empty slots on the advisor cards. Now the problem becomes counting the u
In [16]:
Out[16]:
In [1]:
63-42
Out[1]:
In [ ]: